import request from '@/utils/request'

// 图片上传
export function imageUpload(data) {
    return request({
        url: '/common/file/image/notice',
        method: 'post',
        headers: {
            'Content-Type': 'multipart/form-data' // 确保设置正确的Content-Type
        },
        data
    })
}
// 头像上传
export function avatarUpload(data) {
    return request({
        url: '/common/file/image/avatar',
        method: 'post',
        headers: {
            'Content-Type': 'multipart/form-data' // 确保设置正确的Content-Type
        },
        data
    })
}
// 其他文件上传，例如附件
export function otherUpload(data) {
    return request({
        url: '/common/file/upload',
        method: 'post',
        headers: {
            'Content-Type': 'multipart/form-data' // 确保设置正确的Content-Type
        },
        data
    })
}

//文件下载
export function fileDownload(url) {
    return request({
        url: url,
    })
}